<?php
require_once("conf/db_connection.php");
$trucker = $_GET['trucker'];
$size = $_GET['size'];
$type = $_GET['type'];
$query_truck = "SELECT id,plate FROM truck WHERE trucker_id='".$trucker."' AND equipment_size='".$size."' AND equipment_type='".$type."' AND is_available='1' AND is_deleted='0' ORDER BY PLATE";
$result_truck = mysql_query($query_truck) or die("SELECT AVAIL TRUCKS ".mysql_error());


while($row_truck = mysql_fetch_array($result_truck))
{
	$str_value=$str_value."Array(\"$row_truck[plate]\",\"$row_truck[id]\")".",";
}


$str_value=substr($str_value,0,(strLen($str_value)-1)); // Removing the last char , from the string
echo "new Array($str_value)";
?>